package lunchy.mvc.controllers;

import lunchy.data.interfaces.ILunchyMenuItem;
import lunchy.mvc.models.CLunchyMenuEditItemModel;

public class CLunchyMenuEditItemController
{
	private CLunchyMenuEditItemModel model;

	public CLunchyMenuEditItemController(ILunchyMenuItem item)
	{
		model = new CLunchyMenuEditItemModel(item);
	}

	public void modifyItem(String itemName, String itemPrice)
	{
		Integer iPrice = 0;

		try
		{
			iPrice = Integer.parseInt(itemPrice);
		}
		catch(NumberFormatException ex)
		{
			iPrice = 0;
		}

		model.modifyItem(itemName, iPrice);
	}
}
